package homeworks.cjt2010.homework1;

// 
/**
 * Declares a model of <code>an airplane</code>.
 * <p>This class has a share in {@link Flight Flight class}
 * @author Tsvetan Vasilev
 */
public class Airplane {
	// --- Static Members - blank ----------------------------------------------
	// --- Instance Variables --------------------------------------------------
	private String name = null;
	private int numberOfSeats;
	private int reservedSeats;

	// --- Constructors --------------------------------------------------------

	public Airplane(String name, int numberOfSeats, int reservedSeats) {
		this.name = name;
		this.numberOfSeats = numberOfSeats;
		this.reservedSeats = reservedSeats;
	}

	// --- Getters and Setters -------------------------------------------------
	public int getReservedSeats() {
		return reservedSeats;
	}

	public void setReservedSeats(int reservedSeats) {
		this.reservedSeats = reservedSeats;
	}

	public String getName() {
		return name;
	}

	public int getNumberOfSeats() {
		return numberOfSeats;
	}

	// --- Methods -------------------------------------------------------------

	// work version of toString()
	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder(50);
		sb.append("Plane: ").append(name);
		return sb.toString();
	}
	
	
//	@Override
//	public String toString() {
//		StringBuilder sb = new StringBuilder(50);
//		sb.append("Airplane: name= ").append(name);
//		sb.append(", numberOfSeats= ").append(numberOfSeats);
//		sb.append(", reservedSeats= ").append(reservedSeats);
//		return sb.toString();
//	}

}
